package com.yl.service;

import com.yl.dto.CommentDTO;
import com.yl.entity.Comment;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yangl
 */
@Service
public class CommentClientService {

    @DubboReference
    private CommentService commentService;

    public void saveEntity(CommentDTO commentDTO){
        Comment comment = new Comment();
        BeanUtils.copyProperties(commentDTO, comment);
        commentService.saveEntity(comment);
    }

    public List<Comment> commentList(){
        return commentService.commentList();
    }
}
